package main

import "fmt"

func filterNums(nums []int, filterFunction func(int) bool) []int {
	var xs []int
	for _, num := range nums {
		if filterFunction(num) {
			xs = append(xs, num)
		}
	}
	return xs
}

func main() {
	nums := []int{1, 3, 4, 5, 6, 7, 9}
	rs := filterNums(nums, func(i int) bool {
		return i%2 == 0
	})
	fmt.Println(rs)
}
